<!doctype html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
  <title>异步加载地图</title>
  <link rel="stylesheet" href="../../static/kye-map.min.css" />
  <style>
    html,
    body,
    #container {
      width: 100%;
      height: 100%;
    }
  </style>
</head>

<body>
  <div id="container"></div>
  <script>
    function onApiLoaded() {
      var map = new KMap.Map('container', {
        center: [117.000923, 36.675807],
        zoom: 6
      })
    }
    var url = '../../static/kye-map.min.js';
    var jsapi = document.createElement('script');
    jsapi.charset = 'utf-8';
    jsapi.src = url;
    document.head.appendChild(jsapi);
    window.onload = function () {
      onApiLoaded();
    }
  </script>
</body>

</html>